app.controller('whiteController',["$http","$scope",function($http,$scope){
	var indexZ = document.querySelector('.indexZ');
		$http({
				method: 'GET',
				url: 'white/json/white.json'
		}).then(function (obj) {
	    var arr = obj.data.resultData.resultFloorList
	        $scope.data = arr;
			var myImg = $scope.data[2].groupList[0].elementList[0].eproductImgA
			var myDiv = document.querySelector('.tp');
			myDiv.src = myImg;
       		run();
		}, function (err) {
			console.log(err);
		})
    function run(){
      var mySwiper = new Swiper ('.whiteLunbo', {
        autoplayDisableOnInteraction : false, //实现继续播放
        autoplay: 2000,                     //实现自动播放
        loop:true,                         //实现环路播放

        // 如果需要分页器-------------------------------
        pagination: '.swiper-pagination',
      })
    }
		// 本地存储
		ls();
		function ls(){
			var localstroage = window.localStorage;
			window.onunload = function() {
				localstroage.setItem('banner','false');
			}
			//使用本地存储来控制广告
			//获取广告
			var myBanner = document.querySelector("#w-banner");
			var openid = localstroage.getItem('banner');
			if(openid != 'true'){
				banner()
			}else{
				myBanner.style.display = "none";
			}
			function banner(){
				//获取×号
				var myBtn = document.querySelector("#w-banner p");
				myBtn.addEventListener('touchstart',function(){
					myBanner.style.display = "none"
				})
				localstroage.setItem('banner','true');
			}

	}

}])
